
		<div class="conter">
			<h2>当前位置：<a href="index.html">首页</a>><a href="shop_car.html">我的购物车</a>>确认订单</h2>
			<div class="top">
				<ul>
					<li>我的购物车</li>
					<li class="default">确认订单</li>
					<li>提交订单</li>
				</ul>
			</div>
			<div class="order-title">
				<p>请确认订单信息</p>
			</div>
			<div class="middle">
				<div class="th">
					<ul>
						<li>商品</li>
						<li>商品属性</li>
						<li>单价</li>
						<li>数量</li>
						<li>小计</li>
					</ul>
				</div>
				<volist name="order_info" id="goods">
					<div class="td">
						<ul>
							<li>
								<a href="{:U('Goods/goo_details',array('pro_id'=>$goods['pro_id']))}" class="pro"><img src="__PUBLIC__/Home/Images/order_00.jpg"></a>
								<a href="{:U('Goods/goo_details',array('pro_id'=>$goods['pro_id']))}" class="text"><p>{$goods.pro_name}</p></a>
							</li>
							<li><span>【{$goods.color_name}色】{$goods.catename}</span></li>
							<li>
								<span>{$goods.price}</span>
								<button>特价产品</button>
							</li>
							<li>
								<span>{$goods.number}</span>
							</li>
							<li>
								<span>{$goods['price']*$goods['number']}</span>
							</li>
						</ul>
					</div>
				</volist>
				
			</div>
			<div class="order-title">
				<p>请确认收货地址</p>
			</div>
			<div class="bottom">
				<ul>
					<volist name="address" id="addr">
						<li>
							<if condition="$addr['address_id'] eq $defaul['default_id']"><button class="on"><else/><button></if>{$addr.shname}（收）<i> {$addr.province}</i></button>
							<span>
								<p>地址：{$addr.province}{$addr.city}{$addr.county}{$addr.village}</p>
								<p>电话：{$addr.phone}</p>
								<a class="left" onclick="edit('地址修改','{:U(\'Home/User/address_edit\',array(\'address_id\'=>$addr[\'address_id\']))}',945,395)">修改</a><input type="hidden" value="{$addr.address_id}"/><a class="right def" >默认地址</a>
							</span>
						</li>
					</volist>
					
				</ul>
			</div>
			<script>
			
				$(".conter .bottom ul li button").click(function(){
					$(this).addClass("on")
					$(this).parents().siblings("li").find("button").removeClass("on")
				})
			</script>
			<div class="submit">
				<div class="delivery">
					<label>配送方式：</label>
					<select>
						<option>卖家承担</option>
					</select>
				</div>
				<div class="delivery">
					<label>使用优惠券：</label>
					<select>
						<option>请选择优惠券</option>
					</select>
				</div>
				<textarea placeholder="订单留言：" id="message"></textarea>
				<div class="submit-bot">
					<a href="" id="submit">提交订单</a>
				</div>
			</div>
			
		</div>
<script type="text/javascript">
	$(".def").click(function(){
		var address_id = $(this).prev().val();
		var li = $(this).parent().parents();
		var on = $(this).parent().parent();
		$.post("{:U('defau')}",{address_id:address_id},function(data){
			if(data.code == 1){
				layer.alert(data.info,{end:function(){
					
					li.each(function(){
						$(this).find('button').removeClass('on');
					})
					on.find('button').addClass('on');
				}});
			}else{
				layer.alert(data.info);
			}
		})
	})

	function edit(title,url,w,h){
		layer_show(title,url,w,h);
	}

	$("#submit").click(function(){
		var li = $('.bottom ul li');
		var address_id = '';
		li.each(function(){
			var a = $(this).find('.on').html();
			if(a){
				address_id = $(this).find('input').val();
			}
		})
		var sum_price = 0;
		$('.middle .td').each(function(){
			sum_price += parseFloat($(this).find('li').eq(4).find('span').text());
		})
		
		var message = $("#message").val();
		$.post("",{address_id:address_id,message:message,sum_price:sum_price},function(data){
			if(data.code == 1){
				window.location.href="{:U('pay')}"+"?order_id="+data.order_id;
				// layer.alert(data.info);
			}else{
				layer.alert(data.info);
			}
		})
		// location.href = "{:('pay')}"+"/address_id/"+address_id;
		return false;
	})
</script>